<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@include file="../../common/taglibs.jsp"%>
<%@include file="../../common/_head.jsp"%>
<html>
<head>
    <title>管理员管理</title>
</head>
<body pname="<%=basePath%>">
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-col-md12">
                <div class="layui-card">
                    <%--<div class="layui-card-header">管理员列表</div>--%>
                    <table class="layui-hide" id="data-table" lay-filter="data-table"></table>

                    <script type="text/html" id="data-table-toolbar">
                        <div class="layui-btn-container">
                            <c:forEach items="${userPermissions}" var="permission">
                                <c:if test="${permission eq '/adminUser/add'}">
                                    <button class="layui-btn layui-btn-sm" lay-event="add">新增</button>
                                </c:if>
                                <c:if test="${permission eq '/adminUser/del'}">
                                    <button class="layui-btn layui-btn-sm" lay-event="del">删除</button>
                                </c:if>
                            </c:forEach>
                        </div>
                    </script>

                    <script type="text/html" id="data-table-bar">
                        <c:forEach items="${userPermissions}" var="permission">
                            <c:if test="${permission eq '/adminUser/edit'}">
                                <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
                            </c:if>
                            <c:if test="${permission eq '/adminUser/resetPwd'}">
                                <a class="layui-btn layui-btn-xs" lay-event="restPwd">重置密码</a>
                            </c:if>
                            <c:if test="${permission eq '/adminUser/del'}">
                                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
                            </c:if>
                        </c:forEach>
                    </script>

                    <script type="text/html" id="statusTpl">
                        <c:choose>
                            <c:when test="${fn:contains(userPermissions, '/adminUser/changeStatus')}">
                                <input type="checkbox" name="sex" value="{{ d.id }}" lay-skin="switch" lay-text="启用|禁用" lay-filter="changeStatus" {{ d.status == 0 ? 'checked' : '' }}>
                            </c:when>
                            <c:otherwise>
                                <input type="checkbox" name="sex" value="{{ d.id }}" lay-skin="switch" disabled lay-text="启用|禁用" lay-filter="changeStatus" {{ d.status == 0 ? 'checked' : '' }}>
                            </c:otherwise>
                        </c:choose>
                    </script>
                </div>
            </div>
        </div>
    </div>
</div>

<script src="<%=path%>/js/systemmanage/adminUser/list.js?v=1.1.0"></script>
</body>
</html>
